package com.wn.consumer.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2022 -08-31
 * @desc
 *   消息队列中的消息的消费者
 */
@Component
@Slf4j
public class WorkConsumer2 {

    /**
     * @RabbitListener 监听 队列中的 消息 如果有就进行消费
     *   queues  监听的队列 直接给队列名称就可以
     */
    @RabbitListener(queues = "hello-queue2")
    public void consumerZhangSan(String msg){

        log.info("张三消费者消费:{}",msg);

    }

    @RabbitListener(queues = "hello-queue2")
    public void consumerLisi(String msg){
        log.info("李四消费者消费:{}",msg);
    }

}
